package com.hzcx.app.simplechat.chat.emoji;


import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hzcx.app.simplechat.R;

import java.util.List;

public class EmojiAdapter extends BaseQuickAdapter< EmojiBean, BaseViewHolder> {

    public EmojiAdapter(@Nullable List<EmojiBean> data) {
        super(R.layout.rv_item_chat_emoji,  data);
    }

    public EmojiAdapter(@Nullable List<EmojiBean> data, int index, int pageSize) {
         super(R.layout.rv_item_chat_emoji,  data);
     }

    @Override
    protected void convert(BaseViewHolder helper, EmojiBean item) {
        //判断是否为最后一个item
        if (helper.getAdapterPosition()==mData.size()-1) {
             helper.setBackgroundRes(R.id.et_emoji,R.mipmap.rc_icon_emoji_delete );
        } else {
             helper.setText(R.id.et_emoji,item.getUnicodeInt() );
        }
    }
}
